package com.smartstate.dataManagement.controller;

import com.smartstate.EnvironmentMonitor.vo.ResultVO;
import com.smartstate.dataManagement.dto.EnergyDTO;
import com.smartstate.dataManagement.mapper.PowerMeterSummaryMapper;
import com.smartstate.dataManagement.service.EnergyPanelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;


@RestController
@Slf4j
@RequestMapping("/energyPanel")
public class EnergyPanelController {

    @Autowired
    private PowerMeterSummaryMapper powerMeterSummaryMapper;

    @Resource
    private EnergyPanelService energyPanelService;

    /**
     * 能源看板十四天峰谷平
     * @return
     */
    @GetMapping("/queryEnergyData")
    public ResultVO queryEnergyData(){
        return ResultVO.ok(energyPanelService.queryEnergyData());
    }


    /**
     * 对象组能耗返回
     * @param energyDTO
     * @return
     */
    @PostMapping("/queryObjectgroups")
    public ResultVO queryObjectgroups(@RequestBody EnergyDTO energyDTO){
        return ResultVO.ok(energyPanelService.queryObjectgroups(energyDTO));
    }



}
